package com.sino.operation.controller;

import com.sino.operation.commons.response.CenterResponseEntity;
import com.sino.operation.param.out.EscReciveByCounter;
import com.sino.operation.service.business.StartServiceImpl;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 行内转账业务入口
 */
@Slf4j
@RestController
@RequestMapping("exchange")
@Api(value = "普通汇兑",tags = "普通汇兑的发起、查询等信息")
public class ExchangeController {
    @Autowired
    private StartServiceImpl startService;

    @RequestMapping("/startExchange")
    public CenterResponseEntity startExchange(@RequestBody @Valid EscReciveByCounter escReciveByCounter){

        try {
          String  parameter = startService.startTrans(escReciveByCounter);
        } catch (Exception e) {
            e.printStackTrace();
            return CenterResponseEntity.buildError();
        }
        return CenterResponseEntity.build();
    }

}
